package com.anng.hosp.controller;

import com.anng.common.result.Result;
import com.anng.hosp.service.DepartmentService;
import com.anng.hosp.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Morgan
 * @create 2021-12-28-16:21
 */
@Api(tags = "科室相关信息")
@RestController
@RequestMapping("/admin/hosp/department")
@CrossOrigin    //解决跨域问题
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院的编号,查询医院所有科室列表
    @ApiOperation("查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }
}

























